<script setup>
import {ref, reactive} from 'vue'

let username = ref('admin')
let user = reactive({
  username: "",
  password: "",
  hobby: []
})
let show = () => {
  console.log(user)
}
</script>
<template>
  <div>
    用户名：<input v-model="user.username" /><br />
    密码：<input v-model="user.password" /><br />
    爱好：<input type="checkbox" value="篮球" v-model="user.hobby" />篮球
    <input type="checkbox" value="足球" v-model="user.hobby" />足球
    <input type="checkbox" value="乒乓球" v-model="user.hobby" />乒乓球 <br />
    {{ user }}  <br />
    <button value="点击" @click="show">查看</button>
  </div>

</template>
<style scoped>
</style>